<?php

error_reporting(0);

define("ACCESS_THISSCRIPT", "public");

require_once 'config.php';
require_once 'classes/MySqlWrapper.class.php';
require_once 'classes/TemplateHandler.class.php';
require_once 'classes/HookController.class.php';

global $config;

$sql = new MySqlWrapper($config['hostname'], $config['username'], $config['password'], $config['database'], false);

$hc = new HookController();
$hc->registerHook("PAGE_LOAD");

$tplHead = new TemplateHandler(ACCESS_THISSCRIPT."_head.php");
$tplBody = new TemplateHandler(ACCESS_THISSCRIPT."_body.php");
$tplFoot = new TemplateHandler(ACCESS_THISSCRIPT."_foot.php");

$q = $sql->query("SELECT * FROM settings LIMIT 1");
$info = $sql->fetchArray($q, MYSQL_ASSOC);
$sql->freeResult($q);

$tplHead->assign("page_title", $info['site_title']);

$hc->initHooks();

$tplHead->display();
$tplBody->display();
$tplFoot->display();
?>